$.ajax({
    url: '/api/order_month_gmv_data',
    type: 'get',
    data: {},
    success: function (resp) {
        month = resp.month
        gmv_data = resp.gmv_data

        var chartDom = document.querySelector('#line', 'blue')
        var myChart = echarts.init(chartDom);
        var option;

        option = {
            title: {
                text: '2019年每月的GMV走势'
            },
            tooltip: {
                trigger: 'item'
            },
            xAxis: {
                type: 'category',
                data: month,
                name: '月份',
            },
            yAxis: {
                type: 'value',
                scale: true,
                show: true,
                name: '交易流水 (单位:万元)',

            },
            series: [{
                name:'交易流水',
                data: gmv_data,
                type: 'line',
                smooth: true,
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            }]
        };

        option && myChart.setOption(option);
    }
})



